// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import FastClick from 'fastclick'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'

import filters from './filters' //将全部过滤器放在 filters/index.js 中便于管理
import store from './store/'

// 注册全局过滤器
filters(Vue)
Vue.use(ElementUI)
router.beforeEach(function (to, from, next) {
    store.dispatch('getBannerList');
    store.dispatch('get_news_list');
    next()
})

router.afterEach(function (to) {

})

FastClick.attach(document.body)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: { App }
})
